//
//  UIImage+Helper.h
//  TakeBus
//
//  Created by cqck on 2017/8/7.
//  Copyright © 2017年 cqck-zzh. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (Helper)

/*! 
 * @brief 创建圆形图片
 * @param imageNamed    图片名字
 * @return UIImage 实例
 */
+ (instancetype)imageCircleWithImageNamed:(NSString *)imageNamed;

/*!
 * @brief 创建圆形图片
 * @param imageNamed    图片名字
 * @param borderColor   边框颜色
 * @param borderWidth   边框宽度
 * @return UIImage 实例
 */
+ (instancetype)imageCircleWithImageNamed:(NSString *)imageNamed
                              borderColor:(UIColor *)borderColor
                              borderWidth:(CGFloat)borderWidth;

/*!
 * @brief 创建圆形图片
 * @param imageNamed    图片名字
 * @param borderImage   边框图片
 * @param borderWidth   边框宽度
 * @return UIImage 实例
 */
+ (instancetype)imageCircleWithImageNamed:(NSString *)imageNamed
                              borderImage:(NSString *)borderImage
                              borderWidth:(CGFloat)borderWidth;

/*!
 * @brief 根据指定位置、大小切割图片
 * @param imageNamed    图片名字
 * @param rect          指定位置、大小
 * @return UIImage 实例
 */
+ (instancetype)imageNamed:(NSString *)imageNamed clipRect:(CGRect)rect;

+ (instancetype)triangleImageWithSize:(CGSize)size tintColor:(UIColor *)tintColor;

+ (instancetype)createImageWithColor:(UIColor *)color;

+ (instancetype)convertViewToImage:(UIView *)view;

+ (NSData *)compressWithImage:(UIImage *)image size:(CGFloat)size;

+ (UIImage *)createOpaqueWithImage:(UIImage *)image;

+ (UIImage *)clicpViewWithImage:(UIImage *)image rect:(CGRect)aRect;

+ (UIImage *)imageFromImage:(UIImage *)image inRect:(CGRect)rect;

+ (UIImage *)loadGifWithData:(NSData *)imageData;
@end
